﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/ADAdminLayout.master" AutoEventWireup="true"
    CodeFile="danh_sach_quang_cao_doanh_nghiep.aspx.cs" Inherits="admin_Default2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="block" id="block-tables">
        <div class="content">
            <h2 class="title">
                Danh Sách Quảng Cáo Doanh Nghiệp</h2>
            <div class="inner">
                <div class="group">
                    <label>
                        Từ khóa:</label>
                    <asp:TextBox ID="TextBox1" runat="server" class="text_field" size="60"></asp:TextBox>
                    &nbsp;
                    <label>
                        Tìm theo:
                    </label>
                    <select>
                        <option>Tên doanh nghiệp</option>
                        <option>Tên sản phẩm</option>
                    </select>
                    &nbsp;
                    <button class="button slim-button" type="submit">
                        <img src="./images/search.png" alt="Tìm kiếm">
                        Tìm kiếm</button>
                </div>
                <br />
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" CssClass="table" DataSourceID="SqlDataSourceDanhSachQuangCaoDN">
                    <Columns>
                        <asp:TemplateField HeaderText="All" ItemStyle-HorizontalAlign="Left">
                            <HeaderTemplate>
                                <asp:CheckBox ID="chkAll" runat="server" onclick="SelectOrUnselectAll(this,'chkRow')" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkRow" runat="server" onclick="Check('chkRow')" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="STT">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ten_doanh_nghiep" HeaderText="Tên doanh nghiệp" SortExpression="ten_doanh_nghiep" />
                        <asp:BoundField DataField="ten_sp" HeaderText="Tên sản phẩm" SortExpression="ten_sp" />
                        <asp:BoundField DataField="gia_goc" HeaderText="Giá gốc" SortExpression="gia_goc" />
                        <asp:BoundField DataField="gia_km" HeaderText="Giá khuyến mãi" SortExpression="gia_km" />
                        <asp:BoundField DataField="da_duoc_duyet" HeaderText="Đã được duyệt" SortExpression="da_duoc_duyet" />
                    </Columns>
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSourceDanhSachQuangCaoDN" runat="server" ConnectionString="<%$ ConnectionStrings:babydealConnectionString %>"
                    SelectCommand="SELECT doanh_nghiep.ten_doanh_nghiep, khuyen_mai.ten_sp, khuyen_mai.gia_goc, khuyen_mai.gia_km, khuyen_mai.da_duoc_duyet FROM doanh_nghiep INNER JOIN khuyen_mai ON doanh_nghiep.id = khuyen_mai.id_doanh_nghiep">
                </asp:SqlDataSource>
            </div>
        </div>
    </div>
</asp:Content>
